
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <link rel="stylesheet" href="__CSS__xtbpaycss/mui.min.css?version={:config('version')}"/>
    <link rel="stylesheet" href="__CSS__xtbpaycss/style.css?version={:config('version')}"/>
    <style type="text/css">
        .mui-content > .mui-table-view {
            margin: 0;
        }

        .mui-table-view:after {
            height: 1px;
            left: 15px;
            right: 15px;
        }

        .mui-table-view-cell p {
            font-size: 14px;
            line-height: 24px;
            color: #999;
        }

        .mui-table-view .mui-media, .mui-table-view .mui-media-body {
            overflow: hidden;
            display: inline;
        }

        .mui-table-view .mui-media {
            padding-bottom: 20px;
            display: block;
        }

        .mui-table-view .mui-media-object {
            display: inline-block;
            vertical-align: middle;
            max-width: 48px;
            width: 48px;
            height: 48px;
        }

        .mui-media-body {
            display: inline-block;
            vertical-align: middle;
            font-size: 26px;
            font-weight: 500;
            line-height: 1;
        }

        .mui-btn {
            position: absolute;
            left: 15px;
            right: 15px;
            bottom: 50px;
        }

        .pad-a {
            padding: 40px 15px;
        }

        .money {
            font-size: 22px;
            color: #666;
            font-weight: 400;
        }
    </style>
</head>

<body class="bg-white">
<div class="mui-content">
    <div class="mui-table-view align pad-a">
        <div class="mui-media">
            <img src="__IMAGES__/success.png" class="mui-media-object"/>
            <div class="mui-media-body">付款成功</div>
        </div>
        <div class="money">-{$data['amount']}</div>
    </div>
    <ul class="mui-table-view mar-t">
        <li class="mui-table-view-cell">
            <p>收款商家：{$data['payee']}</p>
                <p>支付方式：{$data['paytype']}</p>
            <p>付款时间：{$data['paytime']}</p>
        </li>
    </ul>
    <button type="button" class="mui-btn mui-btn-green mui-btn-block">关闭</button>
</div>

</body>

</html>

<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script type="text/javascript" src="__JS__xtbpayjs/jquery-1.9.1.min.js"></script>
<script type="text/javascript">

    wx.ready(function () {
        $("button").click(function () {
            wx.closeWindow();
        })
    });

    wx.error(function (res) {
        // config信息验证失败会执行error函数，如签名过期导致验证失败，具体错误信息可以打开config的debug模式查看，也可以在返回的res参数中查看，对于SPA可以在这里更新签名。
    });

    //微信配置
    function config(data) {
        var singature = {
            "debug": false,//// 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
            "appId": data.result.appId,//// 必填，公众号的唯一标识
            "timestamp": data.result.timestamp,// 必填，生成签名的时间戳
            "nonceStr": data.result.nonceStr,// 必填，生成签名的随机串
            "signature": data.result.signature,// 必填，签名，见附录1
            "jsApiList": ["closeWindow"]// 必填，需要使用的JS接口列表，所有JS接口列表见附录2
        };
        wx.config(singature);
    }

    $(function () {
        var baseurl = location.href.split('&state=')[0];
        baseurl = location.href;
        baseurl = encodeURIComponent(baseurl);
        //发送请求
        jQuery.ajax({
            type: "POST",
            url: "/api.signature?url="+ baseurl,
            date: {},
            dataType: "json",
            cache: false,
            success: function (data) {
                if (data.status == "2000") {
                    config(data);
                } else {
                    //	window.location.href
                }
            },
            error: function () {
                //window.location.href = "/showError.action?msg=系统忙,请稍后.";
            }
        });
    });
</script>


